import request from '@/utils/request'
import {Toast } from 'vant';

export function api_register(data) {
    return request({
        url: '/user/register',
        method: 'post',
        data
    })
}

export function api_login(data) {
    return request({
        url: '/user/login',
        method: 'post',
        data
    })
}

export function api_resetpassword(data) {
    return request({
        url: '/user/password/reset',
        method: 'post',
        data
    })
}

export function api_changepassword(data) {
    return request({
        url: '/user/password/update',
        method: 'post',
        data
    })
}

export function api_getVcode(phone,type) {
    let data = {
        type:type,
        mobile:phone,
        project:"WhnAE2"
    }

    return request({
        url: '/user/sms/send',
        method: 'post',
        data
    })
}

// export function api_resetpassword(token) {
//     return request({
//         url: '/user/password/reset',
//         method: 'get',
//         params: { token }
//     })
// }

export function api_logout() {
    return request({
        url: '/user/logout',
        method: 'post'
    })
}



export function api_userMaster() {
    return request({
        url: '/user/master',
        method: 'get',
    })
}

export function api_getwxuserinfo(code) {
    return request({
        url: '/wechat/user/info',
        method: 'get',
        params: { code }

    })
}

export function api_complaintSuggestion(data) {
    return request({
        url: '/user/suggestion',
        method: 'post',
        data
    })
}

export function api_suggestionTips(data) {
    return request({
        url: '/user/suggestion/tips',
        method: 'get',
        data
    })
}
